﻿using System.ComponentModel.Composition;
using System.Web.Mvc;
using Autofac;
using Autofac.Core;
using Autofac.Integration.Mvc;

namespace Actya.Plugins.Hello
{
	/// <summary>
	/// Autofac module that registers components of this module.
	/// </summary>
	[Export(typeof(IModule))]
	public class HelloModule : Module
	{
		protected override void Load(ContainerBuilder builder)
		{
			// Register controllers
			builder.RegisterControllers(GetType().Assembly)
				.Named<IController>(t => t.Name.Replace("Controller", string.Empty))
				.AsSelf();
		}
	}
}